﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace XdbHelper
{
    public partial class InputDialog : Form
    {
        public Action<string, bool> mClick;
        public InputDialog()
        {
            InitializeComponent();
        }
        public InputDialog(string title,string defaultValue,Action<string,bool> _click){
            InitializeComponent();
            Text = title;
            mClick = _click;
            textBox1.Text = defaultValue;
        }


        private void button1_Click(object sender, EventArgs e)
        {
            Hide();
            mClick?.Invoke(textBox1.Text,true);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Hide();
            mClick?.Invoke(textBox1.Text, true);

        }
    }
}
